
const { resolve } = require("path")
const HTMLWebpackPlugin = require("html-webpack-plugin");
const webpack = require("webpack")
const AddAssetHtmlWebpackPlugin = require("add-asset-html-webpack-plugin");

module.exports = {
    entry: "./index.js",
    output: {
        filename: "bundle.js",
        path: resolve(__dirname, "build")
    },
    module: {
        rules: [
            // loader的配置
        ]
    },
    plugins:[
        new HTMLWebpackPlugin({
            template: "./index.html"
        }),
        // 告诉webpack哪些库不参与打包,同时使用名称也得改变
        new webpack.DllReferencePlugin({
            manifest: resolve(__dirname, "dll/manifest.json")
        }),
        // // 在html页面中引入dll资源
        new AddAssetHtmlWebpackPlugin({
            filepath: resolve(__dirname, "dll/jquery.js")
        })
    ],
    mode: "development"
}